module game
{
	export class UIManager
	{
		private static _instance:UIManager;

		public constructor()
		{
		}

		public static getInstance():UIManager
		{
			if(this._instance == null)
			{
				this._instance = new UIManager();
			}

			return this._instance;
		}

		private login:Login;

		public openLogin():void
		{
			if(this.login == null)
			{
				this.login = new Login();
			}

			LayerManager.root.removeChildren();
			LayerManager.root.addChild(this.login);
		}

		private editor:EditorMainUI;
		public openEditor(mapId:number = null):void
		{
			if(this.editor == null)
			{
				this.editor = new EditorMainUI(mapId);
			}
			
			LayerManager.root.removeChildren();
			LayerManager.root.addChild(this.editor);
		}

		private openGame():void
		{

		}

		/**将内容复制到剪切板 */
        public static copyTxt(txt:string): void
        {
            window["copyTxt"](txt);
        }
	}
}